﻿namespace CodingExercises._21_30;

public class RegisterUser
{
    public void Method(string username, string password, int age, string email)
    {
        // 验证用户注册数据
        if (username is null)
        {
            throw new ArgumentNullException(nameof(username), 
                "UserName cannot be null.");
        }
        if (username ==string.Empty)
        {
            throw new ArgumentException("UserName cannot be empty.",
                nameof(username));
        }
    }
}